package com.j283_5.wisdom_park.controller.bill_management;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.Visitors;
import com.j283_5.wisdom_park.vo.bill_management.CarBillsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/CarBills")
@Api(value = "车辆账单管理",tags = "车辆账单管理",produces="冯弋舟")
public class CarBillsController {
    /**
     * 多条件查询车辆账单信息
     * @return
     */
    @RequestMapping(value = "/findCarBills" , method = RequestMethod.GET)
    @ApiOperation(value = "多条件查询车辆账单信息",notes = "多条件查询车辆账单信息（分页）",produces="冯弋舟", response = ResultData.class)
    public ResultData findCarBills(@Param("page") Page<Visitors> page, @Param("carBillsVo") CarBillsVo carBillsVo){
        List<CarBillsVo> list=new ArrayList<>();
        CarBillsVo carBillsVo1=new CarBillsVo(1,"表名","罗遗言",0,"123","豫A00FX2","2020款 2.5L 无级 尊贵版",0,300.0,new Timestamp(System.currentTimeMillis()),"杭州久拓咨询有限公司","A1",
                502,"src/main/resources/img",new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis()),0,"src/main/resources/img");
        list.add(carBillsVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 查询车辆账单详情
     * @return
     */
    @RequestMapping(value = "/findCarBillsInfo" , method = RequestMethod.GET)
    @ApiOperation(value = "查询车辆账单详情",notes = "查询车辆账单详情",produces="冯弋舟", response = ResultData.class)
    public ResultData findCarBillsInfo(@Param("carBillsVo") CarBillsVo carBillsVo){
        List<CarBillsVo> list=new ArrayList<>();
        CarBillsVo carBillsVo1=new CarBillsVo(1,"表名","罗遗言",0,"123","豫A00FX2","2020款 2.5L 无级 尊贵版",0,300.0,new Timestamp(System.currentTimeMillis()),"杭州久拓咨询有限公司","A1",
                502,"src/main/resources/img",new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis()),0,"src/main/resources/img");
        list.add(carBillsVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 新增车辆账单
     * @return
     */
    @RequestMapping(value = "/insertCarBills" , method = RequestMethod.GET)
    @ApiOperation(value = "新增车辆账单",notes = "新增车辆账单",produces="冯弋舟", response = ResultData.class)
    public ResultData insertCarBills(@Param("carBillsVo") CarBillsVo carBillsVo){
        List<CarBillsVo> list=new ArrayList<>();
        CarBillsVo carBillsVo1=new CarBillsVo(1,"表名","罗遗言",0,"123","豫A00FX2","2020款 2.5L 无级 尊贵版",0,300.0,new Timestamp(System.currentTimeMillis()),"杭州久拓咨询有限公司","A1",
                502,"src/main/resources/img",new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis()),0,"src/main/resources/img");
        list.add(carBillsVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 删除车辆账单
     * @return
     */
    @RequestMapping(value = "/deleteCarBills" , method = RequestMethod.POST)
    @ApiOperation(value = "删除车辆账单",notes = "删除车辆账单",produces="冯弋舟", response = ResultData.class)
    public ResultData deleteCarBills(@Param("carBills_id") Integer carBills_id){

        return ResultData.ok();
    }
}
